<!DOCTYPE html>
<html>

<head>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <style>
        * {
            box-sizing: border-box;
        }

        ul {
            list-style-type: none;
            padding: 0;
            margin: 0;
        }

        ul li {
            border: 1px solid #ddd;
            margin-top: -1px;
            /* Prevent double borders */
            background-color: #f6f6f6;
            padding: 12px;
        }
    </style>
</head>

<body>

    <h2>List Group</h2>
    <p>Transform a basic list into a list group:</p>

    <ul>
        <li>Adele</li>
        <li>Agnes</li>
        <li>Billy</li>
        <li>Bob</li>
        <li>Cindy</li>
    </ul>

    <pre>
    <h2>
    这里预防两条 border, 使用了 margin-top: -1px

    ul li {
        border: 1px solid #ddd;
        margin-top: -1px;
        /* Prevent double borders */
        background-color: #f6f6f6;
        padding: 12px;
    }
    </h2>
    </pre>

</body>

</html>